home *** CD-ROM | disk | FTP | other *** search
/ An Invitation to the Roland World of Music / Roland - An Invitation To The Roland World Of Music.bin / specs / chsum.txt next >
Text File  |  1994-07-28  |  1KB  |  35 lines

  1. CALCULATING THE CHECKSUM FOR ROLAND SYSTEM EXCLUSIVE MESSAGES 
  2.  
  3. The checksum verifies the number of bytes in the Data Body portion of a
  4. Roland system exclusive message (such as a data request message).  
  5.  
  6. There is an established formula for finding the correct checksum of the Data
  7. Body in your message. The method for checksumming is as follows: 
  8.  
  9. 1. The Data Body consists of the Starting Address and the Size Byte (refer to
  10. your Roland manual for the System Exclusive Message data format).  Add all of
  11. the bytes of the Data Body together (the numbers are in hexadecimal).  
  12.  
  13. 2. If the result of the above mentioned addition is less than 80(H), subtract
  14. it from 80(H).  If the result is larger than 80(H), subtract 80(H) as many
  15. times as necessary until it is less than 80(H) and then subtract it from
  16. 80(H).  
  17.  
  18. 3. The result of this subtraction is the checksum. An example would be as
  19. follows: 
  20.  
  21. If the total bytes of the Data Body = A and the number to subtract "A" from =
  22. B, then B - A = Checksum.  
  23.  
  24. Example Data Body = 08 00 00 00 7E 0E Sum of Bytes = 94(H) (this would be
  25. "A") Since 94(H) is larger than 80(H), we'll subtract it from 80(H) as "B". 
  26.  
  27. Formula = (B - A = Checksum)  or... Formula = 94(H) - 80(H) = 14(H). Now -
  28. 80(H) - 14(H) = 6C(H) is your checksum. 
  29.  
  30. The Checksum will be followed by the End of Exclusive Message.  This is a
  31. standard convention and will always be F7(H). 
  32.  
  33. Hope this helps you compute Roland's checksum formula, good luck.
  34.  
  35.